***********************
***** PANEL A *********
***********************
clear all 
set more off
cd "/Users/yasenov/Dropbox/mariel_boatlift/jhr_version/jhr_figures"
global folder /Users/yasenov/Dropbox/mariel_boatlift/revision_version/revision_data/
set scheme s1color

use $folder/aux_march.dta
keep if age >= 19 & age <= 65
gen miami = metarea == 5000

collapse (mean) low_skilled cuban cuban_lowskilled [pw=wtsupp], by(year miami)
gen cuban_lowskilled_rel_mar = cuban_lowskilled / low_skilled
rename cuban cuban_mar
keep if miami == 1
drop miami cuban_lowskilled low_skilled

keep if year >= 1973 & year <= 1985

/* linearly interpolate the 1980 value */
replace year = year + 1 if year >= 1981
rename (cuban_m cuban_l) (cub1 cub2)
reshape long cub, i(year) j(new)
reshape wide cub, i(new) j(year)
gen cub1981 = .
replace cub1981 = (cub1980 + cub1982) / 2
reshape long cub, i(new) j(year)
reshape wide cub, i(year) j(new)
rename (cub1 cub2) (cuban_mar cuban_lowskilled_rel_mar) 
/*  								 */

twoway (line cuban_mar year, lcolor(black) lpattern(solid)) ///
	(line cuban_lowskilled_rel_mar year, lcolor(gs10) lpattern(solid)), ///
	xline(1980, lpattern(dash) lcolor(black)) xtitle("") ///
	subtitle("March CPS") ///
	legend(off) ///
	xlabel(1973 "1973" 1974 "74" 1975 "75" 1976 "76" 1977 "77" 1978 "78" 1979 "79" ///
	1980 `""79" "Pre""' 1981 `""80" "Shock""' 1982 `""81" "Post""' 1983 "82" 1984 "83" 1985 "84" 1986 "85")  ///
	text(.5 1985 "Panel A")

graph export "jhr_fig1a.pdf", replace

***********************
***** PANEL B *********
***********************
clear
use $folder/aux_may-org.dta

gen miami = smsa == 26
keep if age >= 19 & age <= 65
collapse (mean) low_skilled cuban cuban_lowskilled [pw=weight], by(year miami)

gen cuban_lowskilled_rel_may = cuban_lowskilled / low_skilled
rename cuban cuban_may
keep if miami == 1
drop miami cuban_lowskilled low_skilled

keep if year >= 1972 & year <= 1985

twoway (line cuban_may year, lcolor(black) lpattern(solid)) ///
	(line cuban_lowskilled_rel_may year, lcolor(gs10) lpattern(solid)), ///
	xline(1979, lpattern(dash) lcolor(black)) xtitle("") ///
	subtitle("May + ORG CPS") ///
	legend(label(1 "share of population") label(2 "share of dropouts")) ///
	xlabel(1973 "1973" 1974 "74" 1975 "75" 1976 "76" 1977 "77" 1978 "78" 1979 `""79" "Pre""' ///
	1980 `""80" "Shock""' 1981 `""81" "Post""' 1982 "82" 1983 "83" 1984 "84" 1985 "85") ///
	text(.5 1984 "Panel B")

graph export "jhr_fig1b.pdf", replace
